package com.suyang.syt.model.dto;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

public class MySessionContext {
	
	private static final Map<String, HttpSession> ctx = new HashMap<String, HttpSession>(); 
	
	private MySessionContext() {
		
	}

	public static void addSession(HttpSession session) {
		MySessionContext.ctx.put(session.getId(), session);
	}
	
	public static void removeSession(HttpSession session) {
		MySessionContext.ctx.remove(session.getId());
	}
	
	public static HttpSession getSession(String sessionId) {
		return MySessionContext.ctx.get(sessionId);
	}
	
}
